/* eslint-disable array-callback-return */
import { message } from 'antd';
import {
  getEmpList,
  getBaseInfo, // 员工基本信息
  getAddTaskList, // 增员任务
  getReduceTaskList, // 减员任务
  getAdjustTaskList, // 调整任务
  getEmpInsPayInfo, // 社保缴纳查询
  getEmpAccuPayInfo,
  getEmpInsSerInfo, // 社保服务办理
  getEmpInsRefundInfo, // 返款信息
  getWageInfoList,
  getEmpLaborContInfo,
  getSupplyBaseInfo,
  SuppBusiList,
  getOnceChargeList,
  getSupplyList,
  getSupplierListInfo,
  getChargebillListInfo,
  getOncePayListInfo, // 一次性付费
  getPaymentBillInfo, // 付费账单
} from '@/services/integratedqueryns';
import { getArryStringBySymbol } from '@/utils/utils';

export default {
  state: {
    empBaseInfo: {}, // 员工基本信息
    addTaskList: {
      // 增员任务列表数据
      list: [],
    },
    // 接发单减员任务列表数据
    reduceTaskList: {
      // 接发单减员任务列表数据
      list: [],
      pagination: {
        current: 1,
        pageSize: 10,
        total: 10,
      },
    },
    // 增减调整任务列表数据
    adjustTaskList: {
      // 增减调整任务列表数据
      list: [],
      pagination: {
        current: 1,
        pageSize: 10,
        total: 10,
      },
    },
    empInsPayList: {
      // 社保实缴列表数据
      list: [],
    },
    empAccuPayList: {
      // 公积金实缴列表数据
      list: [],
      // pagination: {
      //   current: 1,
      //   pageSize: 2,
      //   total: 2,
      // },
    },
    empInsSerInfoList: {
      // 社保服务办理列表数据
      list: [],
      // pagination: {
      //   current: 1,
      //   pageSize: 2,
      //   total: 2,
      // },
    },
    empInsRefundInfoList: {
      // 返款信息列表数据
      list: [],
      // pagination: {
      //   current: 1,
      //   pageSize: 2,
      //   total: 2,
      // },
    },
    wageDataList: {
      // 代发工资列表数据
      list: [],
      // pagination: {
      //   current: 1,
      //   pageSize: 2,
      //   total: 2,
      // },
    },
    empLaborContInfoList: {}, // 劳动合同信息数据
    supplyBaseInfo: {}, // 供应商基本信息
    custConstList: {
      // 商务合同列表数据
      list: [],
      // pagination: {
      //   current: 1,
      //   pageSize: 10,
      //   total: 10,
      // },
    },
    crmquoDataList: {
      // 报价单列表数据
      list: [],
      // pagination: {
      //   current: 1,
      //   pageSize: 10,
      //   total: 10,
      // },
    },
    onceChargeDataList: {
      // 一次性收费列表数据
      list: [],
      // pagination: {
      //   current: 1,
      //   pageSize: 2,
      //   total: 2,
      // },
    },
    billList: {
      // 客户账单列表数据
      list: [],
      pagination: {
        current: 1,
        pageSize: 10,
        total: 10,
      },
    },
    // 供应商协议列表
    supplierList: {
      // 供应商协议列表
      list: [],
      pagination: {
        current: 1,
        pageSize: 10,
        total: 10,
      },
    },
    supplyList: [],
    SuppBusiData: [],
    suppId: null,
    // 收费账单列表数据
    chargeBillListData: {
      // 收费账单列表数据
      list: [],
      pagination: {
        current: 1,
        pageSize: 10,
        total: 10,
      },
    },
    // 一次性付费列表数据
    oncePayListData: {
      // 一次性付费列表数据
      list: [],
      pagination: {
        current: 1,
        pageSize: 10,
        total: 10,
      },
    },
    // 付费账单
    paymentBillListData: {
      // 付费账单
      list: [],
      pagination: {
        current: 1,
        pageSize: 10,
        total: 10,
      },
    },
    type: 1,
    empLabelObj: undefined,
    suppLabelObj: undefined,
  },
  effects: {
    *fetchSupplyList({ payload }, { call, put }) {
      const response = yield call(getSupplyList, payload);
      if (response.success) {
        yield put({
          type: 'supplyList',
          payload: { supplyList: response.data },
        });
      } else {
        message.warning(response.message);
      }
    },
    // 获取雇员列表
    *getEmpList({ payload, callback = () => {} }, { call }) {
      const response = yield call(getEmpList, payload);
      callback(response);
    },
    // 获取员工基本信息
    *getBaseInfo({ payload }, { call, put }) {
      const response = yield call(getBaseInfo, payload);
      yield put({
        type: 'getBaseList',
        payload: {
          data: {},
        },
      });
      if (response.success) {
        yield put({
          type: 'getBaseList',
          payload: {
            data: response.data,
          },
        });
      } else {
        message.warning(response.message || '获取员工基本信息错误：服务器端错误');
      }
    },
    // 获取增员任务列表
    *getAddTaskList({ payload }, { call, put }) {
      const response = yield call(getAddTaskList, payload);
      const {
        pageArg: { currentPage, pageSize },
      } = payload;
      yield put({
        type: 'getAddTask',
        payload: {
          data: {},
          currentPage,
          pageSize,
        },
      });
      if (response.success) {
        yield put({
          type: 'getAddTask',
          payload: {
            data: response.data,
            currentPage,
            pageSize,
          },
        });
      } else {
        message.warning(response.message || '获取增员任务列表数据错误：服务器端错误');
      }
    },
    // 获取减员任务列表
    *getReduceTaskList({ payload }, { call, put }) {
      const response = yield call(getReduceTaskList, payload);
      const {
        pageArg: { currentPage, pageSize },
      } = payload;
      yield put({
        type: 'getReduceTask',
        payload: {
          data: {},
          currentPage,
          pageSize,
        },
      });
      if (response.success) {
        yield put({
          type: 'getReduceTask',
          payload: {
            data: response.data,
            currentPage,
            pageSize,
          },
        });
      } else {
        message.warning(response.message || '获取减员任务列表数据错误：服务器端错误');
      }
    },
    // 获取调整任务列表
    *getAdjustTaskList({ payload }, { call, put }) {
      const response = yield call(getAdjustTaskList, payload);
      const {
        pageArg: { currentPage, pageSize },
      } = payload;
      yield put({
        type: 'getAdjustTask',
        payload: {
          data: {},
          currentPage,
          pageSize,
        },
      });
      if (response.success) {
        yield put({
          type: 'getAdjustTask',
          payload: {
            data: response.data,
            currentPage,
            pageSize,
          },
        });
      } else {
        message.warning(response.message || '获取调整任务列表数据错误：服务器端错误');
      }
    },
    // 获取社保实缴列表
    *getEmpInsPayInfo({ payload }, { call, put }) {
      const response = yield call(getEmpInsPayInfo, payload);
      // const {
      //   pageArg: { currentPage, pageSize },
      // } = payload;
      yield put({
        type: 'empInsPayInfo',
        payload: {
          data: {},
          // currentPage,
          // pageSize,
        },
      });
      if (response.success) {
        yield put({
          type: 'empInsPayInfo',
          payload: {
            data: response.data,
            // currentPage,
            // pageSize,
          },
        });
      } else {
        message.warning(response.message || '获取社保实缴列表数据错误：服务器端错误');
      }
    },
    // 获取公积金实缴列表
    *getEmpAccuPayInfo({ payload }, { call, put }) {
      const response = yield call(getEmpAccuPayInfo, payload);
      // const {
      //   pageArg: { currentPage, pageSize },
      // } = payload;
      yield put({
        type: 'empAccuPayInfo',
        payload: {
          data: {},
          // currentPage,
          // pageSize,
        },
      });
      if (response.success) {
        yield put({
          type: 'empAccuPayInfo',
          payload: {
            data: response.data,
            // currentPage,
            // pageSize,
          },
        });
      } else {
        message.warning(response.message || '获取公积金实缴列表数据错误：服务器端错误');
      }
    },
    // 获取社保服务办理列表
    *getEmpInsSerInfo({ payload }, { call, put }) {
      const response = yield call(getEmpInsSerInfo, payload);
      // const {
      //   pageArg: { currentPage, pageSize },
      // } = payload;
      yield put({
        type: 'empInsSerInfo',
        payload: {
          data: {},
          // currentPage,
          // pageSize,
        },
      });
      if (response.success) {
        yield put({
          type: 'empInsSerInfo',
          payload: {
            data: response.data,
            // currentPage,
            // pageSize,
          },
        });
      } else {
        message.warning(response.message || '获取社保服务办理列表数据错误：服务器端错误');
      }
    },
    // 获取返款信息列表
    *getEmpInsRefundInfo({ payload }, { call, put }) {
      const response = yield call(getEmpInsRefundInfo, payload);
      // const {
      //   pageArg: { currentPage, pageSize },
      // } = payload;
      yield put({
        type: 'empInsRefundInfo',
        payload: {
          data: {},
          // currentPage,
          // pageSize,
        },
      });
      if (response.success) {
        yield put({
          type: 'empInsRefundInfo',
          payload: {
            data: response.data,
            // currentPage,
            // pageSize,
          },
        });
      } else {
        message.warning(response.message || '获取返款信息列表数据错误：服务器端错误');
      }
    },
    // 获取代发工资列表
    *getWageInfoList({ payload }, { call, put }) {
      const response = yield call(getWageInfoList, payload);
      const {
        pageArg: { currentPage, pageSize },
      } = payload;
      yield put({
        type: 'getWageInfoData',
        payload: {
          data: {},
          currentPage,
          pageSize,
        },
      });
      if (response.success) {
        yield put({
          type: 'getWageInfoData',
          payload: {
            data: response.data,
            currentPage,
            pageSize,
          },
        });
      } else {
        message.warning(response.message || '获取代发工资列表数据错误：服务器端错误');
      }
    },
    // 获取劳动合同信息
    *getEmpLaborContInfo({ payload }, { call, put }) {
      const response = yield call(getEmpLaborContInfo, payload);
      yield put({
        type: 'empLaborContInfo',
        payload: {
          data: {},
        },
      });
      if (response.success) {
        yield put({
          type: 'empLaborContInfo',
          payload: {
            data: response.data,
          },
        });
      } else {
        message.warning(response.message || '获取劳动合同信息数据错误：服务器端错误');
      }
    },

    // 获取供应商基本信息
    *getSupplyBaseInfo({ payload }, { call, put }) {
      const response = yield call(getSupplyBaseInfo, payload);
      yield put({
        type: 'getSupplyBaseList',
        payload: {
          data: {},
        },
      });
      if (response.success) {
        yield put({
          type: 'getSupplyBaseList',
          payload: {
            data: response.data,
          },
        });
      } else {
        message.warning(response.message || '获取客户基本信息错误：服务器端错误');
      }
    },
    // 获取商务合同列表数据
    *getSuppBusiData({ payload }, { call, put }) {
      const response = yield call(SuppBusiList, payload);
      yield put({
        type: 'getSuppBusi',
        payload: {
          data: {},
        },
      });
      if (response.success) {
        yield put({
          type: 'getSuppBusi',
          payload: {
            data: response.data,
            // currentPage,
            // pageSize,
          },
        });
      } else {
        message.warning(response.message || '获取商务合同列表数据错误：服务器端错误');
      }
    },
    // 获取一次性收费列表数据
    *getOnceChargeList({ payload }, { call, put }) {
      const response = yield call(getOnceChargeList, payload);
      const {
        pageArg: { currentPage, pageSize },
      } = payload;
      yield put({
        type: 'getOnceChargeData',
        payload: {
          data: {},
          currentPage,
          pageSize,
        },
      });
      if (response.success) {
        yield put({
          type: 'getOnceChargeData',
          payload: {
            data: response.data,
            currentPage,
            pageSize,
          },
        });
      } else {
        message.warning(response.message || '获取一次性收费列表数据错误：服务器端错误');
      }
    },
    // 供应商协议列表数据
    *getSupplierList({ payload }, { call, put }) {
      const {
        pagerArg: { currentPage, pageSize },
      } = payload;
      const response = yield call(getSupplierListInfo, payload);
      yield put({
        type: 'supplierProtocolList',
        payload: {
          data: {},
          currentPage,
          pageSize,
        },
      });

      if (response.success) {
        yield put({
          type: 'supplierProtocolList',
          payload: {
            data: response.data,
            currentPage,
            pageSize,
          },
        });
      } else {
        message.warning(response.message || '获取供应商协议列表数据错误：服务器端错误');
      }
    },

    // 收费账单
    *getChargebillList({ payload }, { call, put }) {
      const {
        pageArg: { currentPage, pageSize },
      } = payload;
      const response = yield call(getChargebillListInfo, payload);
      yield put({
        type: 'chargebillList',
        payload: {
          data: {},
          currentPage,
          pageSize,
        },
      });

      if (response.success) {
        yield put({
          type: 'chargebillList',
          payload: {
            data: response.data,
            currentPage,
            pageSize,
          },
        });
      } else {
        message.warning(response.message || '获取收费账单列表数据错误：服务器端错误');
      }
    },

    // 一次性付费
    *getOncePayList({ payload }, { call, put }) {
      const {
        pageArg: { currentPage, pageSize },
      } = payload;
      const response = yield call(getOncePayListInfo, payload);
      yield put({
        type: 'oncePayList',
        payload: {
          data: {},
          currentPage,
          pageSize,
        },
      });

      if (response.success) {
        yield put({
          type: 'oncePayList',
          payload: {
            data: response.data,
            currentPage,
            pageSize,
          },
        });
      } else {
        message.warning(response.message || '获取收费账单列表数据错误：服务器端错误');
      }
    },

    *getPaymentBillList({ payload }, { call, put }) {
      const {
        pageArg: { currentPage, pageSize },
      } = payload;
      const response = yield call(getPaymentBillInfo, payload);
      yield put({
        type: 'paymentBillList',
        payload: {
          data: {},
          currentPage,
          pageSize,
        },
      });

      if (response.success) {
        yield put({
          type: 'paymentBillList',
          payload: {
            data: response.data,
            currentPage,
            pageSize,
          },
        });
      } else {
        message.warning(response.message || '获取收费账单列表数据错误：服务器端错误');
      }
    },
  },

  reducers: {
    // 获取员工基本信息数据
    getBaseList(
      state,
      {
        payload: { data },
      }
    ) {
      return {
        ...state,
        empBaseInfo: data,
      };
    },
    // 获取增员任务列表数据
    getAddTask(
      state,
      {
        payload: { data, currentPage, pageSize },
        // payload: { data },
      }
    ) {
      const list = Array.isArray(data) ? data : [];
      return {
        ...state,
        addTaskList: {
          list,
          pagination: { total: data.totalCount || '0', current: currentPage, pageSize },
        },
      };
    },
    // 获取减员任务列表数据
    getReduceTask(
      state,
      {
        payload: { data, currentPage, pageSize },
        // payload: { data },
      }
    ) {
      const list = Array.isArray(data) ? data : [];
      return {
        ...state,
        reduceTaskList: {
          list,
          pagination: { total: data.totalCount || '0', current: currentPage, pageSize },
        },
      };
    },
    // 获取调整任务列表数据
    getAdjustTask(
      state,
      {
        payload: { data, currentPage, pageSize },
        // payload: { data },
      }
    ) {
      const list = Array.isArray(data) ? data : [];
      return {
        ...state,
        adjustTaskList: {
          list,
          pagination: { total: data.totalCount || '0', current: currentPage, pageSize },
        },
      };
    },
    // 获取社保实缴列表数据
    // empInsPayInfo(
    //   state,
    //   {
    //     payload: { data, currentPage, pageSize },
    //     // payload: { data },
    //   }
    // ) {
    //   const list = Array.isArray(data) ? data : [];
    //   return {
    //     ...state,
    //     empInsPayList: {
    //       list,
    //       pagination: { total: data.totalCount || '0', current: currentPage, pageSize },
    //     },
    //   };
    // },
    // 获取社保实缴列表数据
    empInsPayInfo(
      state,
      {
        // payload: { data },
        payload: { data },
      }
    ) {
      const list = Array.isArray(data) ? data : [];
      const pageArr = [];
      if (list.length) {
        list.map(item => {
          if (item.empAssList.length) {
            // 基数 empBase+ unitBase
            // 个人比例  empProp
            // 个人缴费  empAmo
            // 公司比例  unitProp
            // 公司缴费  unitAmo
            const obj = {};
            item.empAssList.map(c => {
              obj[`empBase_${c.ass}`] = c.empBase || c.empBase === 0 ? c.empBase : '--';
              obj[`unitBase_${c.ass}`] = c.unitBase || c.unitBase === 0 ? c.unitBase : '--';
              obj[`empProp_${c.ass}`] = c.empProp || c.empProp === 0 ? c.empProp : '--';
              obj[`empAmo_${c.ass}`] = c.empAmo || c.empAmo === 0 ? c.empAmo : '--';
              obj[`unitProp_${c.ass}`] = c.unitProp || c.unitProp === 0 ? c.unitProp : '--';
              obj[`unitAmo_${c.ass}`] = c.unitAmo || c.unitAmo === 0 ? c.unitAmo : '--';
              obj[`indvAccoNo_${c.ass}`] = c.indvAccoNo || c.indvAccoNo === 0 ? c.indvAccoNo : '--';
            });
            pageArr.push({ ...item, ...obj });
          }
        });
      }
      return {
        ...state,
        empInsPayList: {
          list: pageArr,
          // currentPage,
          // pageSize,
        },
      };
    },
    // // 获取公积金实缴列表数据
    // empAccuPayInfo(
    //   state,
    //   {
    //     payload: { data },
    //     // payload: { data },
    //   }
    // ) {
    //   const list = Array.isArray(data) ? data : [];
    //   return {
    //     ...state,
    //     empAccuPayList: {
    //       list,
    //       // pagination: { total: data.totalCount || '0', current: currentPage, pageSize },
    //     },
    //   };
    // },

    // 获取社保实缴列表数据
    empAccuPayInfo(
      state,
      {
        // payload: { data },
        payload: { data },
      }
    ) {
      const list = Array.isArray(data) ? data : [];
      const pageArr = [];
      if (list.length) {
        list.map(item => {
          if (item.empAssList.length) {
            // 基数 empBase+ unitBase
            // 个人比例  empProp
            // 个人缴费  empAmo
            // 公司比例  unitProp
            // 公司缴费  unitAmo
            const obj = {};
            item.empAssList.map(c => {
              obj[`empBase_${c.ass}`] = c.empBase || c.empBase === 0 ? c.empBase : '--';
              obj[`unitBase_${c.ass}`] = c.unitBase || c.unitBase === 0 ? c.unitBase : '--';
              obj[`empProp_${c.ass}`] = c.empProp || c.empProp === 0 ? c.empProp : '--';
              obj[`empAmo_${c.ass}`] = c.empAmo || c.empAmo === 0 ? c.empAmo : '--';
              obj[`unitProp_${c.ass}`] = c.unitProp || c.unitProp === 0 ? c.unitProp : '--';
              obj[`unitAmo_${c.ass}`] = c.unitAmo || c.unitAmo === 0 ? c.unitAmo : '--';
            });
            pageArr.push({ ...item, ...obj });
          }
        });
      }
      return {
        ...state,
        empAccuPayList: {
          list: pageArr,
          // currentPage,
          // pageSize,
        },
      };
    },

    // 获取社保服务办理列表数据
    empInsSerInfo(
      state,
      {
        // payload: { data, currentPage, pageSize },
        payload: { data },
      }
    ) {
      const list = Array.isArray(data) ? data : [];
      return {
        ...state,
        empInsSerInfoList: {
          list,
          // pagination: { total: data.totalCount || '0', current: currentPage, pageSize },
        },
      };
    },
    // 获取返款信息列表数据
    empInsRefundInfo(
      state,
      {
        // payload: { data, currentPage, pageSize },
        payload: { data },
      }
    ) {
      const list = Array.isArray(data) ? data : [];
      return {
        ...state,
        empInsRefundInfoList: {
          list,
          // pagination: { total: data.totalCount || '0', current: currentPage, pageSize },
        },
      };
    },
    // 获取代发工资列表数据
    getWageInfoData(
      state,
      {
        payload: { data, currentPage, pageSize },
        // payload: { data },
      }
    ) {
      const list = Array.isArray(data) ? data : [];
      return {
        ...state,
        wageDataList: {
          list,
          pagination: { total: 0, current: currentPage, pageSize },
        },
      };
    },
    // 获取劳动合同信息列表数据
    empLaborContInfo(
      state,
      {
        payload: { data },
      }
    ) {
      return {
        ...state,
        empLaborContInfoList: data,
      };
    },
    // 获取客户基本信息数据
    getSupplyBaseList(
      state,
      {
        payload: { data },
      }
    ) {
      return {
        ...state,
        supplyBaseInfo: data,
      };
    },
    // 获取商务合同列表数据
    getSuppBusi(
      state,
      {
        // payload: { data, currentPage, pageSize },
        payload: { data },
      }
    ) {
      const newData = [];
      if (data && data.suppBusiScopeList) {
        data.suppBusiScopeList.map(item => {
          newData.push(`${item.areaInfo.areaName}  ,  `);
        });
      }
      if (newData.length) {
        // eslint-disable-next-line prefer-destructuring
        newData[newData.length - 1] = newData[newData.length - 1].split(',')[0];
      }
      return {
        ...state,
        SuppBusiData: newData,
        SuppObj: data,
        suppId: data.suppId,
      };
    },
    // 获取报价单列表数据
    getCrmquoData(
      state,
      {
        // payload: { data, currentPage, pageSize },
        payload: { data },
      }
    ) {
      const list = data.pageRecords && Array.isArray(data.pageRecords) ? data.pageRecords : [];
      return {
        ...state,
        crmquoDataList: {
          list,
          // pagination: { total: data.totalCount || '0', current: currentPage, pageSize },
        },
      };
    },
    // 获取一次性收费列表数据
    getOnceChargeData(
      state,
      {
        payload: { data, currentPage, pageSize },
        // payload: { data },
      }
    ) {
      const list = data.pageRecords && Array.isArray(data.pageRecords) ? data.pageRecords : [];
      return {
        ...state,
        onceChargeDataList: {
          list,
          pagination: { total: 0, current: currentPage, pageSize },
        },
      };
    },

    // 获取客户账单列表数据
    getBillData(
      state,
      {
        payload: { data, currentPage, pageSize },
        // payload: { data },
      }
    ) {
      const list = data.pageRecords && Array.isArray(data.pageRecords) ? data.pageRecords : [];
      return {
        ...state,
        billList: {
          list,
          pagination: { total: 0, current: currentPage, pageSize },
        },
      };
    },
    // 更新数据
    updateModalData(state, { payload }) {
      return {
        ...state,
        ...payload,
      };
    },

    supplyList(state, { payload }) {
      return {
        ...state,
        ...payload,
      };
    },

    // 收费账单
    chargebillList(
      state,
      {
        payload: { data, currentPage, pageSize },
        // payload: { data },
      }
    ) {
      const list = data.pageRecords && Array.isArray(data.pageRecords) ? data.pageRecords : [];
      return {
        ...state,
        chargeBillListData: {
          list,
          pagination: { total: 0, current: currentPage, pageSize },
        },
      };
    },

    // 付费账单
    paymentBillList(
      state,
      {
        payload: { data, currentPage, pageSize },
        // payload: { data },
      }
    ) {
      const list = data.pageRecords && Array.isArray(data.pageRecords) ? data.pageRecords : [];
      return {
        ...state,
        paymentBillListData: {
          list,
          pagination: { total: 0, current: currentPage, pageSize },
        },
      };
    },

    // 一次性付费
    oncePayList(
      state,
      {
        payload: { data, currentPage, pageSize },
        // payload: { data },
      }
    ) {
      const list = data.pageRecords && Array.isArray(data.pageRecords) ? data.pageRecords : [];
      return {
        ...state,
        oncePayListData: {
          list,
          pagination: { total: 0, current: currentPage, pageSize },
        },
      };
    },

    // 供应商协议列表数据
    supplierProtocolList(
      state,
      {
        payload: { data, currentPage, pageSize },
      }
    ) {
      // const list = data.pageRecords && Array.isArray(data.pageRecords) ? data.pageRecords : [];
      const list = Array.isArray(data.pageRecords) ? data.pageRecords : [];
      list.map(item => {
        const temp = item;
        temp.areaNameList = getArryStringBySymbol(item.areaList, 'areaName');
        // item.pdNameList = getArryStringBySymbol(item.detList, 'pdName', '+');
        // item.price = item.detList.reduce((total, currentValue) => total + currentValue.fee || 0, 0);
        item.packList.map(priceitem => {
          const obj = priceitem;
          obj.price = priceitem.detList.reduce(
            (total, currentValue) => total + currentValue.price || total + currentValue.fee || 0,
            0
          );
          obj.pdNameList = getArryStringBySymbol(priceitem.detList, 'pdName', '+');
        });
        temp.price = item.packList.reduce(
          (total, currentValue) => total + currentValue.price || total + currentValue.fee || 0,
          0
        );
        temp.pdNameList = getArryStringBySymbol(item.packList, 'pdNameList', '，');
      });
      return {
        ...state,
        supplierList: {
          list,
          pagination: { total: 0, current: currentPage, pageSize },
        },
      };
    },
  },
};
